import axios from 'axios';
var baseUrl = '';
function build(env) {

  if (typeof env !== 'string') {
    throw '环境参数类型错误';
  }
  switch (env) {
    case 'dev':
      baseUrl = 'http://localhost:8082';
      break;
    case 'pro':
      baseUrl = '';
      break;
    default:
      throw '环境参数错误'
      break;
  }
  if (!baseUrl) {
    throw '缺少配置项'
  }
}

function fetchOverview() {
  return axios(`${baseUrl}/destination/Index/index`);
}

build('dev');
export default {
  fetchOverview
}

